package com.dmcloud.dm.auth.service;

import lombok.Getter;
import lombok.ToString;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * Created by xiaodao
 * date: 2019/11/2
 */
@ToString
@Getter
public class DmUserDetails extends User {

    private String id;
    private Integer deptId;
    private String tenantId;
    private String account;
    private String name;
    private Integer sex;

    public DmUserDetails(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities,
                         String id, Integer deptId, String tenantId, String account, String name, Integer sex) {
        super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
        this.id = id;
        this.deptId = deptId;
        this.tenantId = tenantId;
        this.account = account;
        this.name = name;
        this.sex = sex;
    }
}
